package cn.movie.admin.service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.poi.ss.usermodel.Row;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.druid.util.StringUtils;

@Service
public class movieService {
	@Autowired
	SqlSessionFactory sqlSessionFactory;
	@Autowired
	SqlSession sqlSession;
	
	public List 	selMovieTypeList(Map map){
		return sqlSession.selectList("movieDao.selMovieTypeList",map);
	}
	
	public int selCountMovieType(Map map){
		return sqlSession.selectOne("movieDao.selCountMovieType",map);
	}
	public int saveMovieType(Map map){
		return sqlSession.insert("movieDao.saveMovieType",map);
	}
	public Map selMovieTypeInfo(String movieTypeId){
		return sqlSession.selectOne("movieDao.selMovieTypeInfo",movieTypeId);
	}
	public int editMovieType(Map map){
		return sqlSession.update("movieDao.editMovieType",map);
	}
	public List selMovieByType(String movieTypeId){
		return sqlSession.selectList("movieDao.selMovieByType",movieTypeId);
	}
	public int deleteMovieType(String movieTypeId){
		return sqlSession.update("movieDao.deleteMovieType",movieTypeId);
	}
	public List selMovieList(Map map){
		return sqlSession.selectList("movieDao.selMovieList",map);
	}
	public int selCountMovieList(Map map){
		return sqlSession.selectOne("movieDao.selCountMovieList",map);
	}
	public int saveMovie(Map map){
		return sqlSession.insert("movieDao.saveMovie",map);
	}
	public Map selMovieById(String movieId){
		return sqlSession.selectOne("movieDao.selMovieById",movieId);
	}
	public int editMovie(Map map){
		return sqlSession.update("movieDao.editMovie",map);
	}
	public int delMovie(String movieId){
		return sqlSession.delete("movieDao.delMovie",movieId);
	}
}
